home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 July / macformat52.iso / mac / Shareware Plus / Developers / YAAF v1.0 alpha 1 / Headers / Core / XDialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-24  |  3.0 KB  |  131 lines

  1. /*    XDialog.h
  2.  *
  3.  *        This contains the declarations for both the modal and the
  4.  *    modeless dialog boxes
  5.  */
  6.  
  7. /*  YAAF - Yet another application framework
  8.  *  Copyright (C) 1997 William Edward Woody and In Phase Consulting
  9.  *  
  10.  *  This library is free software; you can redistribute it
  11.  *  and/or modify it under the terms of the GNU Library
  12.  *  General Public License as published by the Free Software
  13.  *  Foundation; either version 2 of the License, or any
  14.  *  later version.
  15.  *  
  16.  *  This library is distributed in the hope that it will be
  17.  *  useful, but WITHOUT ANY WARRANTY; without even the implied
  18.  *  warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
  19.  *  PURPOSE. See the GNU Library General Public License for
  20.  *  more details.
  21.  *  
  22.  *  You should have received a copy of the GNU Library General
  23.  *  Public License along with this library; if not, write to the
  24.  *  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  25.  *  Boston, MA 02111-1307, USA.
  26.  *  
  27.  *  To contact the author, either e-mail me at
  28.  *  woody@alumni.caltech.edu, or write to us at
  29.  *  
  30.  *          William Edward Woody
  31.  *          In Phase Consulting
  32.  *          1545 Ard Eevin Avenue
  33.  *          Glendale, CA 91202
  34.  */
  35.  
  36. #ifndef __XDIALOG_H__
  37. #define __XDIALOG_H__
  38.  
  39. #include <XWindow.h>
  40.  
  41. #if defined(__MWERKS__)
  42.     #if defined(macintosh)
  43.         #pragma options align=power
  44.     #endif
  45.     #if defined(__INTEL__)
  46.         #pragma pack(push,2)
  47.     #endif
  48. #endif
  49.  
  50. /************************************************************************/
  51. /*                                                                        */
  52. /*    Forwards                                                            */
  53. /*                                                                        */
  54. /************************************************************************/
  55.  
  56. class XGDialog;
  57.  
  58. /************************************************************************/
  59. /*                                                                        */
  60. /*    Modal Dialog Declarations                                            */
  61. /*                                                                        */
  62. /************************************************************************/
  63.  
  64. /*
  65.  *    Procedure callback
  66.  */
  67.  
  68. typedef long (*XGPDialogProc)(XGDialog *,void *,long,long,void *);
  69.  
  70. /*    XGDialog
  71.  *
  72.  *        This is the dialog box declaration. This declaration is set
  73.  *    up so I can be created either modal or modeless; modal dialogs
  74.  *    should use the modal dialog function setup given below
  75.  */
  76.  
  77. class XGDialog : public XGWindow {
  78.     public:
  79.                                 XGDialog(XGSWindowInitRecord &);
  80.                                 XGDialog(XGArgStream &);
  81.         virtual                    ~XGDialog();
  82.         bool                    CloseWindow();
  83.         
  84.         /*
  85.          *    Modeless creation/destruction
  86.          */
  87.         
  88.         static XGDialog            *Create(short,XGPDialogProc, void *);
  89.         
  90.         /*
  91.          *    Modal creation/destruction
  92.          */
  93.         
  94.         static long                ModalDialog(short,XGPDialogProc, void *);
  95.         
  96.         /*
  97.          *    End the dialog
  98.          */
  99.         
  100.         void                    EndDialog(long v);
  101.         
  102.         /*
  103.          *    Message management
  104.          */
  105.         
  106.         long                    ReceiveDispatch(long,long,void *);
  107.  
  108.     private:
  109.         long                    SendMessage(long,long,void *);
  110.  
  111.         long                    fTermValue;
  112.         bool                    fTerminate;
  113.         bool                    fModal;
  114.         void                    *fDataPtr;
  115.         XGPDialogProc            fDialogProc;
  116. };
  117.  
  118.  
  119.  
  120. #if defined(__MWERKS__)
  121.     #if defined(macintosh)
  122.         #pragma options align=reset
  123.     #endif
  124.     #if defined(__INTEL__)
  125.         #pragma pack(pop)
  126.     #endif
  127. #endif
  128.  
  129.  
  130. #endif // __XDIALOG_H__
  131.